﻿Public Class Form1
    Private m_Results As New Dictionary(Of Integer, Integer)

    Private m_Min As Integer = 0
    Private m_Max As Integer = 100

    Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        Chart1.Series.Clear()

        Chart1.Series.Add("Rand")
    End Sub

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Dim res = RealRandom.Rand(m_Min, m_Max)

        If m_Results.ContainsKey(res) Then
            m_Results(res) += 1
        Else
            m_Results.Add(res, 1)
        End If

        Chart1.Series("Rand").Points.AddXY(res, m_Results(res))
    End Sub
End Class